package com.dtwave.wechat.service.provider.core.job;

import com.dtwave.wechat.service.provider.common.utils.ThreadFactoryUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Description:
 * @Author: chenjs
 * @CreateDate: 2018/11/2 15:31
 * @Version: 1.0
 */
public class BaseTask {

    protected static final ThreadPoolExecutor JOB_POOL =
            new ThreadPoolExecutor(2, 10, 60L,
                                   TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
                                   ThreadFactoryUtil.newFactory("task_"), new ThreadPoolExecutor.CallerRunsPolicy());
    protected Logger logger = LoggerFactory.getLogger(getClass());
}
